<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
	<h:form id="formEdit" prependId="false">
		<div>
			<rich:panel header="#{messages['label.certificate']}" style="width: 550px; margin: auto;">
				<table style="width: 100%;">
					<tr>
						<td style="width: 25%;"><h:outputText value="#{messages['label.application']}" /> : </td>
						<td style="width: 75%;">
							<h:outputText value="#{certificateBean.application.alias}"/>
							-
							<h:outputText value="#{certificateBean.application.name}"/>
						</td>
					</tr>
					<tr>
						<td><h:outputText value="#{messages['label.alias']}" /> : </td>
						<td>
							<h:inputText id="alias" value="#{certificateBean.alias}" size="15" maxlength="45">
								<f:validateLength minimum="3" maximum="45" />
								<rich:validator />
							</h:inputText>
						</td>
					</tr>
					<tr>
						<td><h:outputText value="#{messages['label.file']}" /> : </td>
						<td>
							<rich:fileUpload id="file" acceptedTypes="cer, crt, der" fileUploadListener="#{certificateBean.uploadListener}" maxFilesQuantity="1" listHeight="1" >
								<a4j:ajax event="uploadcomplete" execute="@none" render="formEdit:btnSave" />
							</rich:fileUpload>
						</td>
					</tr>
					<tr>
						<td colspan="2" style="text-align: center;">
							<h:commandButton id="btnSave" value="#{messages['label.save']}" action="#{certificateBean.upload}" disabled="#{empty certificateBean.uploadedFile}" />
							<h:commandButton value="#{messages['label.cancel']}" action="#{certificateBean.cancel}" immediate="true"/>			
						</td>
					</tr>
				</table>					
			</rich:panel>
		</div>
	</h:form>
</html>